<template>
    <v-dialog v-model="existsDialog" width="500px" persistent overlay-opacity="0.2">
        <div style="background-color: white;">
            <div class="text-center text-h6 pt-3">
                存在重复文件
            </div>
            <v-container>
                <v-row v-for="item in existsList" :key="item.id">
                    <v-col>
                        <v-icon size="28px" class="mr-2" :color="getIconByType(item.type, item.name).color">
                            {{getIconByType(item.type, item.name).icon}}
                        </v-icon>
                        <span id="file-name">{{ item.name }}</span>
                    </v-col>
                </v-row>
                <v-row>
                    <v-col>
                        <v-btn @click="$emit('close')" block color="primary">确定</v-btn>
                    </v-col>
                </v-row>
            </v-container>
        </div>
    </v-dialog>
</template>

<script>
    import {getIconByType} from "../../../util";

    export default {
        name: "MyExistsDialog",
        props: {
            existsDialog: {
                type: Boolean,
                default: false
            },
            existsList: {
                type: Array,
                default: () => {
                    return []
                }
            }
        },
        methods: {
            getIconByType
        }
    }
</script>

<style scoped>

</style>